import { BaseEntity } from "./base"

export const TestGroupFields = `
name
order
status
desc
`
export interface TestGroupEntity extends BaseEntity {
  name: string
  order: number
  status: number
  desc: string
  tests?: TestEntity[]
}
export const TestFields = `
name
order
status
desc
sys_test_groupId
`
export interface TestEntity extends BaseEntity {
  name: string
  order: number
  status: number
  desc: string
  sys_test_groupId: number
  group?: TestGroupEntity
  chapters?: TestChapterEntity[]
}

export const TestChapterFields = `
name
desc
order
status
PPT
PDF
video
one2one
outline
money
is_test
sys_testId
is_lock
`
export interface TestChapterEntity extends BaseEntity {
  name: string
  desc: string
  order: number
  status: number
  PPT: string
  PDF: string
  video: string
  one2one: string
  outline: string
  money: number
  is_test: number
  sys_testId: number
  test?: TestEntity
  papers?: TestPaperEntity[]
  is_lock?: boolean
}
// @Field()
// name: string;

// @Field(() => Int)
// order: number;

// @Field(() => Boolean)
// status: boolean;

// @Field({ nullable: true })
// desc: string;

// @Field(() => Int)
// sys_test_chapterId: number;

// @Field(() => Boolean)
// is_free: boolean;

// @Field(() => SysTestChapterEntity, { nullable: true })
// chapter?: SysTestChapterEntity

// @Field(() => [SysTestQuestionEntity], { nullable: true })
// questions?: SysTestQuestionEntity[]

// @Field(() => Int)
// time: number
export const TestPaperFields = `
name
order
status
desc
sys_test_chapterId
is_free
time
`
export interface TestPaperEntity extends BaseEntity {
  name: string
  order: number
  status: number
  desc: string
  sys_test_chapterId: number
  is_free: number
  chapter?: TestChapterEntity
  time: number
  questions?: TestPaperQuestionEntity[]
}
export const TestQuestionFields = `
name
order
status
desc
sys_test_paperId
answer
content
score
count
right
type
help
`
export interface TestPaperQuestionEntity extends BaseEntity {
  name: string
  order: number
  status: number
  desc: string
  sys_test_paperId: number
  answer: string
  content: string
  score: number
  count: number
  right: number
  type: string
  help: string
  sys_test_paper?: TestPaperEntity
  position?: number
}
